function [value,isterminal,direction] = events1(t,z)


global par

kB = z(3);

value = kB;
isterminal = 1;   % Stop the integration
direction = -1;   % it's initially positive and decreasing to zero
